// 变量类型检查
var myName = 'Packt';
myName = 10;
// 变量类型推断
var favoritelanguage;
var langs = ['javaScript', 'Ruby', 'Python'];
favoritelanguage = langs[0];
function printName(person) {
    console.log(person.name);
}
var john = { name: 'John', age: 21 };
//  鸭子类型
var mary = { name: 'Mary', age: 21, phone: '123-4578' };
printName(john);
printName(mary);
